namespace Knlght.Repository.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate1 : DbMigration
    {
        public override void Up()
        {
            DropPrimaryKey("dbo.SysSetting");
            CreateTable(
                "dbo.SysDynamicMenu",
                c => new
                    {
                        ID = c.String(nullable: false, maxLength: 128),
                        Title = c.String(),
                        IconClass = c.String(),
                        Url = c.String(),
                        DispayIndex = c.Int(nullable: false),
                        AddTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.SysMenuColumn",
                c => new
                    {
                        Id = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            AlterColumn("dbo.SysAdministrators", "Username", c => c.String(nullable: false));
            AlterColumn("dbo.SysAdministrators", "Email", c => c.String());
            AlterColumn("dbo.SysRoleInfo", "Name", c => c.String(nullable: false, maxLength: 10));
            AlterColumn("dbo.SysLogInfo", "AddTime", c => c.DateTime());
            AlterColumn("dbo.SysLogInfo", "Description", c => c.String());
            AlterColumn("dbo.SysNewsInfo", "Title", c => c.String());
            AlterColumn("dbo.SysNewsInfo", "SmallTitle", c => c.String());
            AlterColumn("dbo.SysNewsInfo", "Content", c => c.String(storeType: "ntext"));
            AlterColumn("dbo.SysNewsType", "Name", c => c.String());
            AlterColumn("dbo.SysLinkInfo", "Name", c => c.String());
            AlterColumn("dbo.SysSetting", "Key", c => c.String(nullable: false, maxLength: 128));
            AddPrimaryKey("dbo.SysSetting", "Key");
        }
        
        public override void Down()
        {
            DropPrimaryKey("dbo.SysSetting");
            AlterColumn("dbo.SysSetting", "Key", c => c.String(nullable: false, maxLength: 200));
            AlterColumn("dbo.SysLinkInfo", "Name", c => c.String(maxLength: 200));
            AlterColumn("dbo.SysNewsType", "Name", c => c.String(maxLength: 500));
            AlterColumn("dbo.SysNewsInfo", "Content", c => c.String());
            AlterColumn("dbo.SysNewsInfo", "SmallTitle", c => c.String(maxLength: 600));
            AlterColumn("dbo.SysNewsInfo", "Title", c => c.String(maxLength: 900));
            AlterColumn("dbo.SysLogInfo", "Description", c => c.String(maxLength: 1000));
            AlterColumn("dbo.SysLogInfo", "AddTime", c => c.DateTime());
            AlterColumn("dbo.SysRoleInfo", "Name", c => c.String(nullable: false, maxLength: 200));
            AlterColumn("dbo.SysAdministrators", "Email", c => c.String(maxLength: 300));
            AlterColumn("dbo.SysAdministrators", "Username", c => c.String(nullable: false, maxLength: 200));
            DropTable("dbo.SysMenuColumn");
            DropTable("dbo.SysDynamicMenu");
            AddPrimaryKey("dbo.SysSetting", "Key");
        }
    }
}
